package com.xry.util;

import lombok.Data;

@Data
public class Page {
    Integer current = 1; // 页码，默认第一页
    private Integer limit = 10; // 每页显示条数，默认10条

    public Integer getStart() {
        // 添加空值检查，设置默认值
        if (current == null || current <= 0) {
            current = 1; // 默认第一页
        }
        if (limit == null || limit <= 0) {
            limit = 10; // 默认每页10条记录
        }
        return (current - 1) * limit;
    }

    private Integer count = 0; // 表中数据总条数，默认0
    private Object data;
}
